
If you compile, but DON'T link, useFunctions.c, you will see
that the compiler can use the declarations from myFunctions.h
to compile the calls to myFunction() and printf(), but the
compiler does not yet know where the definitions (i.e., the
actual code) for these two function will come from nor where
the code will be placed in memory. So the compiler leaves a
blank space in the actual compiled calls to myFunction()
and printf() (in the object file useFunctions.o).

After you compile myFunction.c and link useFunctions.o to
myFunction.o (and also to the C Standard Library), then the
linker fills in (in useFunctions.exe) the blank space left
by the compiler for the calls to myFunction() and printf().


Here are commands for every step of the compilation process
(including the preprocessor step, the compiling step,
the assembler step, and the linking step).

gcc -E      useFunctions.c  -o useFunctions.i    (preprocessor step)
gcc -S      useFunctions.i  -o useFunctions.s    (compiling step)
gcc -c      useFunctions.s  -o useFunctions.o    (assembling step)
objdump -d  useFunctions.o                       (look inside object file)
gcc -S      myFunctions.c   -o myFunctions.s
gcc -c      myFunctions.s   -o myFunctions.o
objdump -d  myFunctions.o
gcc         useFunctions.o myFunctions.o  -o useFunctions.exe  (linking step)
objdump -d  useFunctions.exe



Without using the compiler driver as much.

cpp     useFunctions.c  -o useFunctions.i    (preprocessor step)
gcc -S  useFunctions.i  -o useFunctions.s    (compiling step)
as      useFunctions.s  -o useFunctions.o    (assembling step)
gcc -S  myFunctions.c   -o myFunctions.s
as      myFunctions.s   -o myFunctions.o
ld      useFunctions.o myFunctions.o  -o useFunctions.exe  (linking step, but this doesn't work)
gcc     useFunctions.o myFunctions.o  -o useFunctions.exe  (linking step)





With debugging information. This lets us mix the
original source code with the assembly code when
we look inside of the object files.

gcc -E      useFunctions.c  -o useFunctions.i
gcc -S -g   useFunctions.i  -o useFunctions.s
gcc -c -g   useFunctions.s  -o useFunctions.o
objdump -S  useFunctions.o
gcc -S -g   myFunctions.c   -o myFunctions.s
gcc -c -g   myFunctions.s   -o myFunctions.o
objdump -S  myFunctions.o
gcc         useFunctions.o myFunctions.o  -o useFunctions.exe
objdump -S  useFunctions.exe
